-
-
Notifications
You must be signed in to change notification settings - Fork 359
Update C implementations for Verlet algorithms #298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
while (pos > 0) { | ||
time += dt; | ||
(*time) += dt; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need the brackets there.
} | ||
|
||
void stormer_verlet(double pos, double acc, double dt) { | ||
double prev_pos, temp_pos, time, vel; | ||
void stormer_verlet(double *time, double *vel, double pos, double acc, double dt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is too long, move the double dt) {
part on a new line.
double time, vel; | ||
vel = 0; | ||
time = 0; | ||
void velocity_verlet(double *time, double *vel, double pos, double acc, double dt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is also too long.
velocity_verlet(5.0, -10, 0.01); | ||
double time_v; | ||
double time_sv, vel_sv; | ||
double time_vv, vel_vv; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not have one time and velocity variable since you set it to zero at the start of every function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
Done according to #257.